/**
 * Created by Administrator on 2017/2/11.
 */
import { Component,OnInit } from '@angular/core';
import {UsereditService } from './userserve.serve';

@Component({
    selector: 'my-edit',
    templateUrl: 'useredit.html',
    providers:[ UsereditService ]
})
export class EditComponent implements OnInit{
   constructor(
     private usereditService:UsereditService
   ){}
     private userediter='';
     private errorMessage='';
     private infromation='';
  ngOnInit(){
      this.usereditService.useredit()
        .subscribe(
          res=>{
            this.userediter=res['data'];
            console.log(this.userediter)
          },
          error =>this.errorMessage = <any>error
        )
   }
   givinf(type:string,username:string,pwd:string,repwd:string,language:string,vocation:string,company:string,address:string){
     this.usereditService.revise(type,username,pwd,repwd,language,vocation,company,address)
       .subscribe(
         res=>{this.infromation=res}
       );
     alert( '已经被提交!');
   }
}
